package com.example.studentdemo.mapper;

import com.example.studentdemo.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {
    List<Student> selectAll(Student student);

    void insert(Student student);

    @Select("select * from `student` where username = #{username}")
    Student selectByUsername(String username);

    void updateById(Student student);

    @Delete("delete from `student` where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from `student` where id = #{id}")
    Student selectById(Integer id);
}
